/*
 * Equilibrator.h
 *
 *  Created on: 2 Aug 2011
 *      Author: Allan
 */

#ifndef EQUILIBRATOR_H_
#define EQUILIBRATOR_H_

// C++ includes
#include <vector>
#include <string>
using namespace std;

// Eigen includes
#include <Eigen/Core>
using namespace Eigen;

// GeoReact includes
#include "../EquilibriumSolver/EquilibriumSolver.h"
#include "../System.h"
#include "../SystemState.h"

class Equilibrator 
{
public:
	Equilibrator();
	
	Equilibrator(const System& system);
	
	void
	AddCondition(const string& type);
	
	void
	AddCondition(const string& type, double value);
	
	void
	AddCondition(const string& type, const string& species, double value);
	
	void
	Reset();
	
	const SystemState
	Equilibrate(double T, double P);
	
private:
	System system;
	
	EquilibriumSolver eSolver;
	
	vector<EquilibriumCondition> eConditions;
	
	VectorXd n;
};

#endif /* EQUILIBRATOR_H_ */
